package com.gitee.feizns.web.dao.handler.meta.annotation;

import com.gitee.feizns.web.dao.handler.meta.FillGenerator;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @CustomFill(IgGenerator.class)
 * @TableField(fill = FieldFill.INSERT)
 * @TableId(type = IdType.INPUT)
 * String id;
 *
 * class IgGenerator implements FillGenerator<Test, String> {
 *
 *      private static int i = 0;
 *
 *      @Override
 *      public Integer generate(Test test) {
 *          System.out.println(test.getName());
 *          return i++;
 *      }
 *
 * }
 *
 * @author feizns
 * @since 2019/8/4 0004
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CustomFill {

    /**
     * 自定义填充规则
     * @return
     */
    Class<? extends FillGenerator> value();

}
